Skip to main content

Class UnaryInstruction<TValue1, TValueType1, TValue2, TValueType2>

Base class for unary operator instructions with different input and output types.

Assembly: WaaS.Core.dll
Declaration
public abstract class UnaryInstruction<TValue1, TValueType1, TValue2, TValueType2> : Instruction where TValue1 : unmanaged where TValueType1 : struct, IValueType<TValue1> where TValue2 : unmanaged where TValueType2 : struct, IValueType<TValue2>

Inheritance: System.Object -> WaaS.Models.Instruction

Derived:

Expand

Methods

Execute(WasmStackFrame)

Executes the instruction.

View Source
Declaration
public override void Execute(WasmStackFrame current)
Parameters
TypeName
WaaS.Runtime.WasmStackFramecurrent

Operate(TValue1)

View Source
Declaration
protected abstract TValue2 Operate(TValue1 value)
Returns

<TValue2>

Parameters
TypeName
<TValue1>value

PreValidateStackState(in ValidationContext)

Get the number of values to pop and push from the stack to validate stack depth.

View Source
Declaration
public override (uint popCount, uint pushCount) PreValidateStackState(in ValidationContext context)
Returns

System.ValueTuple<System.UInt32,System.UInt32>

Parameters
TypeName
WaaS.Models.ValidationContextcontext

ValidateStackState(in ValidationContext, ref ValidationBlockStackState)

Simulates stack operations to validate the stack state.

View Source
Declaration
public override void ValidateStackState(in ValidationContext context, ref ValidationBlockStackState stackState)
Parameters
TypeName
WaaS.Models.ValidationContextcontext
WaaS.Models.ValidationBlockStackStatestackState